package com.realbrand.net.realbrandpay.ui.activity.gradevin;

import com.realbrand.net.realbrandpay.base.BasePersenter;
import com.realbrand.net.realbrandpay.bean.GradevinBean;

import java.util.List;

/**
 * Created by Administrator on 2018/7/6.
 */

public class PersenterGradevin extends BasePersenter<IViewGradevin> {

    public void getData() {
        if (!isViewAttched()) {
            return;
        }
        getView().showLoading();
        ModelGradevin.getGradevin(getView().getParamsGradevin(), new IModelGradevin<List<GradevinBean>>() {
            @Override
            public void onSuccess(List<GradevinBean> data) {
                if (isViewAttched()) {
                    getView().showGradevinResult(data);
                }
            }

            @Override
            public void onFail(String msg) {
                if (isViewAttched()) {
                    getView().showFailMsg(msg);
                }
            }

            @Override
            public void onErrorr() {
                if (isViewAttched()) {
                    getView().showError();
                }
            }

            @Override
            public void onComplete() {
                if (isViewAttched()) {
                    getView().hideLoading();
                }
            }
        });
    }
}
